# !/usr/bin/env python3
# -*- coding:utf-8 -*-
# Auther : Liang_lz
# Date : 2023/7/27

from list_tickets import Runner
from list_tickets import Ticket

import threading

if __name__ == '__main__':

    try:

        threads = []  # 启动多个线程
        for i in range(1, 31):  # 创建多个线程
            runner = Runner()
            threads.append(threading.Thread(target=runner.run, name="爬虫{}号".format(i), args=(i,)))

        for thread in threads:  # 启动所有线程
            print("正在启动： {}...".format(thread.name))
            thread.start()
            thread.join()  # 等待线程全部执行完后才能停止主线程
    except KeyboardInterrupt:
        print("正在终止....")
